import { axiosGet } from '../utils/http';

//获取课程分类
function getCourseFields() {
  return new Promise((resolve, reject) => {
    axiosGet({
      url: '/v2/get_course_fields',
      success(data) {
        resolve(data);
      },
      error(err) {
        reject(err);
      },
    });
  });
}

//获取课程列表
function getCourseList() {
  return new Promise((resolve, reject) => {
    axiosGet({
      url: '/v2/get_courses/all',
      success(data) {
        resolve(data);
      },
      error(err) {
        reject(err);
      },
    });
  });
}

export { getCourseFields, getCourseList };
